{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# TDC 103: Datasets Part 2 - Biologics\n",
    "\n",
    "[Kexin](https://twitter.com/KexinHuang5)\n",
    "\n",
    "In this tutorial, we will continue the dataset exploration and now walk through various biologics datasets provided in TDC!\n",
    "\n",
    "We assume you have familiarize yourself with the installations, data loaders, and data functions. If not, please visit [TDC 101 Data Loaders](https://github.com/mims-harvard/TDC/blob/master/tutorials/TDC_101_Data_Loader.ipynb) and [TDC 102 Data Functions](https://github.com/mims-harvard/TDC/blob/master/tutorials/TDC_102_Data_Functions.ipynb) first!\n",
    "\n",
    "TDC has 10 biologics datasets in the first release. We will go with the order of discovery and development stage. \n",
    "\n",
    "### Target Discovery\n",
    "\n",
    "For target discovery, gene disease associtation prediction that we discussed in the last tutotorial also applies here. In addition to that, we include miRNA-Target Interaction (MTI) prediction dataset. miRNAs (microRNAs) are small non-coding RNAs that control expression of target genes at the post-transcriptional level. It was shown by recent research that they play important roles in disease pathology and celluar processes. miRNA therapeutics refer to insert miRNA into cells whereas sometimes miRNA is also regarded as biomarker for other drug products to target upon. miRNA-target interaction is thus very important because it can identify which miRNA can regulate the target of interest. In TDC, we include the miRTarBase database, which was collected by manually surveying literature and are later validated experimentally. TDC also provides miRNA mature sequence and target amino acid sequence as the features for miRNA and target gene. You can obtain it via:\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Downloading...\n",
      "100%|██████████| 338M/338M [00:17<00:00, 19.8MiB/s] \n",
      "Loading...\n",
      "Done!\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>miRNA_ID</th>\n",
       "      <th>miRNA</th>\n",
       "      <th>Target_ID</th>\n",
       "      <th>Target</th>\n",
       "      <th>Y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>ath-miR398c-3p</td>\n",
       "      <td>UGUGUUCUCAGGUCACCCCUG</td>\n",
       "      <td>817365</td>\n",
       "      <td>MAATNTILAFSSPSRLLIPPSSNPSTLRSSFRGVSLNNNNLHRLQS...</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>ath-miR398b-3p</td>\n",
       "      <td>UGUGUUCUCAGGUCACCCCUG</td>\n",
       "      <td>817365</td>\n",
       "      <td>MAATNTILAFSSPSRLLIPPSSNPSTLRSSFRGVSLNNNNLHRLQS...</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         miRNA_ID                  miRNA  Target_ID  \\\n",
       "0  ath-miR398c-3p  UGUGUUCUCAGGUCACCCCUG     817365   \n",
       "1  ath-miR398b-3p  UGUGUUCUCAGGUCACCCCUG     817365   \n",
       "\n",
       "                                              Target  Y  \n",
       "0  MAATNTILAFSSPSRLLIPPSSNPSTLRSSFRGVSLNNNNLHRLQS...  1  \n",
       "1  MAATNTILAFSSPSRLLIPPSSNPSTLRSSFRGVSLNNNNLHRLQS...  1  "
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from tdc.multi_pred import MTI\n",
    "data = MTI(name = 'miRTarBase')\n",
    "data.get_data().head(2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Activity Screening\n",
    "\n",
    "We include four therapeutics tasks to predict the activity of biologics. Immunotherapy is an important diagram of therapeutics. It has gained lots of interests in the recent years because of its promise in treating various cancers and less side effects than small molecule compounds. One big part of immunotherapy is Monoclonal antibody therapy. Antibody binds to antigens and once it binds to antigens, together they serve as a target marker for the humans immune system to attack those marked cells/proteins. In TDC, we include three tasks in predicting the binding of antibody and antigen. The first is paratope prediction, where we want to predict the binding region in antibody. TDC includes a processed dataset from Parapred, which curates a dataset from SAbDab. The dataset contains both heavy and light chain sequence of the antibody and each data point has the chain sequence and the positions index in the chain that correspond to the binding regions."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Downloading...\n",
      "100%|██████████| 150k/150k [00:00<00:00, 855kiB/s] \n",
      "Loading...\n",
      "Done!\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Antibody_ID</th>\n",
       "      <th>Antibody</th>\n",
       "      <th>Y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2hh0_H</td>\n",
       "      <td>LEQSGAELVKPGASVKLSCTASGFNIEDSYIHWVKQRPEQGLEWIG...</td>\n",
       "      <td>[49, 80, 81, 82, 101]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1u8q_B</td>\n",
       "      <td>ITLKESGPPLVKPTQTLTLTCSFSGFSLSDFGVGVGWIRQPPGKAL...</td>\n",
       "      <td>[30, 31, 53, 83, 84, 85, 104, 105, 106, 107, 1...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Antibody_ID                                           Antibody  \\\n",
       "0      2hh0_H  LEQSGAELVKPGASVKLSCTASGFNIEDSYIHWVKQRPEQGLEWIG...   \n",
       "1      1u8q_B  ITLKESGPPLVKPTQTLTLTCSFSGFSLSDFGVGVGWIRQPPGKAL...   \n",
       "\n",
       "                                                   Y  \n",
       "0                              [49, 80, 81, 82, 101]  \n",
       "1  [30, 31, 53, 83, 84, 85, 104, 105, 106, 107, 1...  "
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from tdc.single_pred import Paratope\n",
    "data = Paratope(name = 'SAbDab_Liberis')\n",
    "data.get_data().head(2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Similarly, we can also predict the active binding region in the antigen. TDC uses a dataset from Bepipred, which curates a dataset from IEDB. It collects B-cell epitopes and non-epitope amino acids determined from crystal structures. To load, type: "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Downloading...\n",
      "100%|██████████| 2.18M/2.18M [00:00<00:00, 4.12MiB/s]\n",
      "Loading...\n",
      "Done!\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Antigen_ID</th>\n",
       "      <th>Antigen</th>\n",
       "      <th>Y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Protein 1</td>\n",
       "      <td>MASQKRPSQRHGSKYLATASTMDHARHGFLPRHRDTGILDSIGRFF...</td>\n",
       "      <td>[109, 110, 111, 112, 113, 114, 115, 116, 117, ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Protein 2</td>\n",
       "      <td>MSDLTDIQEDITRHEQQLIVARQKLKDAERAVEVDPDDVNKNTLQA...</td>\n",
       "      <td>[312, 313, 314, 315, 316, 317, 318, 319, 320, ...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Antigen_ID                                            Antigen  \\\n",
       "0  Protein 1  MASQKRPSQRHGSKYLATASTMDHARHGFLPRHRDTGILDSIGRFF...   \n",
       "1  Protein 2  MSDLTDIQEDITRHEQQLIVARQKLKDAERAVEVDPDDVNKNTLQA...   \n",
       "\n",
       "                                                   Y  \n",
       "0  [109, 110, 111, 112, 113, 114, 115, 116, 117, ...  \n",
       "1  [312, 313, 314, 315, 316, 317, 318, 319, 320, ...  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from tdc.single_pred import Epitope\n",
    "data = Epitope(name = 'IEDB_Jespersen')\n",
    "data.get_data().head(2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "While the previous two tasks are antigen/antibody agnostic and focus on identifying the active regions, we can also directly predict antigen-antibody binding affinities. TDC processes a dataset from SAbDab, where we only uses protein/peptide antigens:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Downloading...\n",
      "100%|██████████| 330k/330k [00:00<00:00, 1.02MiB/s]\n",
      "Loading...\n",
      "Done!\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Antibody_ID</th>\n",
       "      <th>Antibody</th>\n",
       "      <th>Antigen_ID</th>\n",
       "      <th>Antigen</th>\n",
       "      <th>Y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1hh6</td>\n",
       "      <td>['QDQLQQSGAELVRPGASVKLSCKALGYIFTDYEIHWVKQTPVHG...</td>\n",
       "      <td>pep-4</td>\n",
       "      <td>DATPEDLGARL</td>\n",
       "      <td>1.000000e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4i2x</td>\n",
       "      <td>['EVKLQQSGPELVKPGASVKISCKASGYSFTSYYIHWVKQRPGQG...</td>\n",
       "      <td>signal-regulatory protein gamma</td>\n",
       "      <td>EEELQMIQPEKLLLVTVGKTATLHCTVTSLLPVGPVLWFRGVGPGR...</td>\n",
       "      <td>1.200000e-06</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Antibody_ID                                           Antibody  \\\n",
       "0        1hh6  ['QDQLQQSGAELVRPGASVKLSCKALGYIFTDYEIHWVKQTPVHG...   \n",
       "1        4i2x  ['EVKLQQSGPELVKPGASVKISCKASGYSFTSYYIHWVKQRPGQG...   \n",
       "\n",
       "                        Antigen_ID  \\\n",
       "0                            pep-4   \n",
       "1  signal-regulatory protein gamma   \n",
       "\n",
       "                                             Antigen             Y  \n",
       "0                                        DATPEDLGARL  1.000000e-07  \n",
       "1  EEELQMIQPEKLLLVTVGKTATLHCTVTSLLPVGPVLWFRGVGPGR...  1.200000e-06  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from tdc.multi_pred import AntibodyAff\n",
    "data = AntibodyAff(name = 'Protein_SAbDab')\n",
    "data.get_data().head(2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note that in practice, as proteins are usually in 3D, an ideal data input is the 3D structure information. However, as obtaining 3D structure is itself expensive for new data points, we here include the accessible sequences information. We plan to add 3D dataset in the future release. \n",
    "\n",
    "In addition to binding affinity, an antibody has also to have good properties to be able to be developed. Immunogenicity, instability, self-association, high viscosity, polyspecificity, or poor expression can all preclude an antibody from becoming a therapeutic. This can be formulated as an antibody developability prediction problem. TDC includes two datasets for that. In the first one, a small dataset is provided by Therapeutic Antibody Profiler where they propose five metrics in measuring the developability of an antibody: CDR length, patches of surface hydrophobicity (PSH), patches of positive charge (PPC), patches of negative charge (PNC), structural Fv charge symmetry parameter (SFvCSP). For example, to retrieve the values of CDR Length, you can type: "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Found local copy...\n",
      "Loading...\n",
      "Done!\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Antibody_ID</th>\n",
       "      <th>Antibody</th>\n",
       "      <th>Y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Abagovomab</td>\n",
       "      <td>['QVKLQESGAELARPGASVKLSCKASGYTFTNYWMQWVKQRPGQG...</td>\n",
       "      <td>46</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Abituzumab</td>\n",
       "      <td>['QVQLQQSGGELAKPGASVKVSCKASGYTFSSFWMHWVRQAPGQG...</td>\n",
       "      <td>45</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Antibody_ID                                           Antibody   Y\n",
       "0  Abagovomab  ['QVKLQESGAELARPGASVKLSCKASGYTFTNYWMQWVKQRPGQG...  46\n",
       "1  Abituzumab  ['QVQLQQSGGELAKPGASVKVSCKASGYTFSSFWMHWVRQAPGQG...  45"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from tdc.single_pred import Develop\n",
    "data = Develop(name = 'TAP', label_name = 'CDR Length')\n",
    "data.get_data().head(2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "All the label names can also accessed via:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['CDR_Length', 'PSH', 'PPC', 'PNC', 'SFvCSP']"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from tdc.utils import retrieve_label_name_list\n",
    "retrieve_label_name_list('TAP')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The label name also supports fuzzy search, so don't worry about typing few characters wrong! \n",
    "\n",
    "TDC also includes another large developability dataset from Chen et al., where they process from the SAbDab dataset. The binary developability label is generated via the BIOVIA's pipeline. It contains 2,409 antibodies: "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Downloading...\n",
      "100%|██████████| 601k/601k [00:00<00:00, 1.48MiB/s]\n",
      "Loading...\n",
      "Done!\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Antibody_ID</th>\n",
       "      <th>Antibody</th>\n",
       "      <th>Y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>12e8</td>\n",
       "      <td>['EVQLQQSGAEVVRSGASVKLSCTASGFNIKDYYIHWVKQRPEKG...</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>15c8</td>\n",
       "      <td>['EVQLQQSGAELVKPGASVKLSCTASGFNIKDTYMHWVKQKPEQG...</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Antibody_ID                                           Antibody  Y\n",
       "0        12e8  ['EVQLQQSGAEVVRSGASVKLSCTASGFNIKDYYIHWVKQRPEKG...  0\n",
       "1        15c8  ['EVQLQQSGAELVKPGASVKLSCTASGFNIKDTYMHWVKQKPEQG...  0"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from tdc.single_pred import Develop\n",
    "data = Develop(name = 'SAbDab_Chen')\n",
    "data.get_data().head(2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Last but not least, TDC also includes two Peptide-MHC binding datasets. Similar to the mechanism of Monoclonal antibody therapy, major histocompatibility complex (MHC) can bind to peptides and display them at the cell surface where human immune system (T-cell) can recognize them and eliminate them. There are various categories of MHC (MHC I, II, III) due to various structural differences. Thus, it is important to predict MHC and peptide binding affinity. In TDC, we include two datasets. The first is from NetMHCpan for MHC class I binding. They collected it from IEDB and IMGT/HLA database. You can retrieve them via:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Downloading...\n",
      "100%|██████████| 15.1M/15.1M [00:01<00:00, 11.2MiB/s]\n",
      "Loading...\n",
      "Done!\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Peptide_ID</th>\n",
       "      <th>Peptide</th>\n",
       "      <th>MHC_ID</th>\n",
       "      <th>MHC</th>\n",
       "      <th>Y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>ARWLASTPL</td>\n",
       "      <td>BoLA-D18.4</td>\n",
       "      <td>YYSEYREISENVYESNLYIAYSDYTWEYLNYRWY</td>\n",
       "      <td>0.589395</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>ASYAAAAAY</td>\n",
       "      <td>BoLA-D18.4</td>\n",
       "      <td>YYSEYREISENVYESNLYIAYSDYTWEYLNYRWY</td>\n",
       "      <td>0.496594</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Peptide_ID    Peptide      MHC_ID                                 MHC  \\\n",
       "0           0  ARWLASTPL  BoLA-D18.4  YYSEYREISENVYESNLYIAYSDYTWEYLNYRWY   \n",
       "1           1  ASYAAAAAY  BoLA-D18.4  YYSEYREISENVYESNLYIAYSDYTWEYLNYRWY   \n",
       "\n",
       "          Y  \n",
       "0  0.589395  \n",
       "1  0.496594  "
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from tdc.multi_pred import PeptideMHC\n",
    "data = PeptideMHC(name = 'MHC1_IEDB-IMGT_Nielsen')\n",
    "data.get_data().head(2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The second dataset is from MHC class II, which originates from NetMHCIIpan collected also from IEDB database. To retrieve this dataset, type:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Downloading...\n",
      "100%|██████████| 11.8M/11.8M [00:01<00:00, 9.86MiB/s]\n",
      "Loading...\n",
      "Done!\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Peptide_ID</th>\n",
       "      <th>Peptide</th>\n",
       "      <th>MHC_ID</th>\n",
       "      <th>MHC</th>\n",
       "      <th>Y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>PKYVKQNTLKLAT</td>\n",
       "      <td>HLA-DPA10103-DPB10201</td>\n",
       "      <td>YAFFMFSGGAILNTLFGQFEYFDIEEVRMHLGMT</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>DSDVGEFRAVTELG</td>\n",
       "      <td>HLA-DPA10103-DPB10201</td>\n",
       "      <td>YAFFMFSGGAILNTLFGQFEYFDIEEVRMHLGMT</td>\n",
       "      <td>0.047212</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Peptide_ID         Peptide                 MHC_ID  \\\n",
       "0           0   PKYVKQNTLKLAT  HLA-DPA10103-DPB10201   \n",
       "1           1  DSDVGEFRAVTELG  HLA-DPA10103-DPB10201   \n",
       "\n",
       "                                  MHC         Y  \n",
       "0  YAFFMFSGGAILNTLFGQFEYFDIEEVRMHLGMT  0.000000  \n",
       "1  YAFFMFSGGAILNTLFGQFEYFDIEEVRMHLGMT  0.047212  "
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from tdc.multi_pred import PeptideMHC\n",
    "data = PeptideMHC(name = 'MHC2_IEDB_Jensen')\n",
    "data.get_data().head(2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "That's it for this tutorial! TDC is in the very initial stage, we only cover tip of an iceberg of all the biologics datasets. Thus, we are actively looking for contributions from domain scientists and ML researchers for new tasks and new datasets. Please [contact us](mailto:kexinhuang@hsph.harvard.edu) if you are interested in contributing!\n",
    "\n",
    "In the next set of tutorials, we are going to cover the following topics:\n",
    "\n",
    "* [TDC 104 ML Model Examples with DeepPurpose](https://github.com/mims-harvard/TDC/blob/master/tutorials/TDC_104_ML_Model_DeepPurpose.ipynb)\n",
    "\n",
    "* [TDC 105 Molecular Oracles](https://github.com/mims-harvard/TDC/blob/master/tutorials/TDC_105_Oracles.ipynb)\n",
    "\n",
    "See you there!"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:DeepPurpose]",
   "language": "python",
   "name": "conda-env-DeepPurpose-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
